/*
*********************************************************************************************************
*                                               uC/OS-II
*                                        The Real-Time Kernel
*
*                        (c) Copyright 1992-1998, Jean J. Labrosse, Plantation, FL
*                                          All Rights Reserved
*                        (c) Copyright ARM Limited 1999.  All rights reserved.
*
*                                          ARM Specific code
*
* File : OS_CPU.H
*********************************************************************************************************
*/

#ifdef  OS_CPU_GLOBALS
#define OS_CPU_EXT
#else
#define OS_CPU_EXT  extern
#endif

/*
*********************************************************************************************************
*                                              DATA TYPES
*                                         (Compiler Specific)
*********************************************************************************************************
*/

typedef unsigned char  BOOLEAN;
typedef unsigned char  INT8U;                    /* Unsigned  8 bit quantity                           */
typedef signed   char  INT8S;                    /* Signed    8 bit quantity                           */
typedef signed 	 short INT16S;					  /* Unsigned 16 bit quantity                           */
typedef unsigned short INT16U;					 /* Signed   16 bit quantity                           */
typedef unsigned int   INT32U;                  /* Unsigned 32 bit quantity                           */
typedef signed   int   INT32S;                  /* Signed   32 bit quantity                           */
typedef long long 	   INT64S;					 /*Signed 64 bit quatity*/

typedef float          FP32;                     /* Single precision floating point                    */
typedef double         FP64;                     /* Double precision floating point                    */

typedef unsigned int   OS_STK;                   /* Each stack entry is 32-bit wide                   */

typedef unsigned int   OS_CPU_SR;				  /* arm cpsr*/



/* 
*********************************************************************************************************
*                              ARM, various architectures
*
*********************************************************************************************************
*/

/**************************************************************************************************
*		Define the method how to enter critical  and exit critiical
*
**************************************************************************************************/
#define OS_CRITICAL_METHOD 3

#if OS_CRITICAL_METHOD == 3
INT32U ARMDisableInt(void);
void ARMEnableInt(OS_CPU_SR cpu_sr);
#define OS_ENTER_CRITICAL()  (cpu_sr = ARMDisableInt())
#define OS_EXIT_CRITICAL()	 (ARMEnableInt(cpu_sr))
#endif

#if OS_CRITICAL_METHOD == 2
#define OS_ENTER_CRITICAL()	
#define OS_EXIT_CRITICAL()
#endif

#if OS_CRITICAL_METHOD == 1
#define	OS_ENTER_CRITICAL()	
#define	OS_EXIT_CRITICAL()	
#endif

void OSCtxSw(void);
#define OS_TASK_SW()	OSCtxSw()
#define OS_STK_GROWTH 1



